<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<meta name="x5-orientation" content="portrait" />
		<meta name="x5-fullscreen" content="true" />
		<meta name="screen-orientation" content="portrait" />
		<meta name="full-screen" content="yes" />
		<link rel="stylesheet" type="text/css" href="css/reset.css" />
		<link rel="stylesheet" type="text/css" href="css/home_page.css" />
		<link rel="stylesheet" type="text/css" href="layui/css/layui.mobile.css" />
		<link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
		<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="js/swiper.min.js"></script>
		<script type="text/javascript" src="js/layer_mobile.js"></script>
		<script type="text/javascript" src="js/NativeShare.js"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<title>首页</title>
	</head>

	<body>
		<!-- header -->
		<header>
			<h3 class="left">车保分</h3>
			<!-- share  -->
			<!--<p class="share right"></p>-->
		</header>
		<!-- share -->
		<div class="share_popups jianthis_style">
			<p>
				<a onclick="call('qqFriend')" class="jiathis_button_cqq"><img src="images/logo/logo.png" /></a>
				<a onclick="call('qZone')" class="jiathis_button_qzone"><img src="images/logo/logo1.png" /></a>
				<a onclick="call('wechatFriend')" class="jiathis_button_weixin"><img src="images/logo/logo2.png" /></a>
				<a onclick="call('wechatTimeline')" class="jiathis_button_tsina"><img src="images/logo/logo3.png" /></a>
			</p>
			<i class="close"></i>
		</div>
		<!-- banner -->
		<div class="swiper-container banner">
			<div class="swiper-wrapper f1">
			</div>
			<!-- 分页器 -->
			<div class="swiper-pagination"></div>
		</div>
		<!-- nav -->
		<nav class="clearfix">
			<div>
				<a href="maintain.html"><img src="images/icon/icon_2.gif" alt="" /><i>汽车保养</i></a>
				<a href="insurance.html"><img src="images/icon/icon_1.gif" alt="" /><i>汽车保险</i></a>
				<!--<a href="javascript:;" id="store"><img src="images/icon/icon_3.gif" alt="" /><i>汽车商城</i></a>-->
				<a href="consumer_gold.html" style="width: 100%;"><img src="images/icon/icon_4.gif" alt="" /><i>消费金</i></a>
			</div>
		</nav>
		<!-- footer -->
		<footer class="footer">
			<ul>
				<li>
					<a href="javascript:;"><img src="images/icon/icon_6.png" alt="" />首页</a>
					<a href="insurance.html"><img src="images/icon/icon_7.png" alt="" />保险</a>
					<a href="maintain.html"><img src="images/icon/icon_8.png" alt="" />保养</a>
					<!--<a class="store" href="javascript:;"><img src="images/icon/icon_9.png" alt="" />商城</a>-->
					<a href="personal_center.html"><img src="images/icon/icon_10.png" alt="" />我的</a>
				</li>
			</ul>
		</footer>
		<!--<script>
		//分享的内容
		var jiathis_config={
			data_track_clickback:true,
			url:"http://www.baidu.com",
			summary:"移动端汽车商战",
			title:"车宝分 #O(∩_∩)O哈哈~#",
			shortUrl:false,
			hideMore:false
		}
	</script>
	<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=2156913" charset="utf-8"></script>-->
		<!-- JiaThis Button END -->
	</body>

</html>
<script type="text/javascript">
	$(function() {
		//分享
		$('.share').on('click', function() {
			$('.share_popups').css({
				'opacity': 1,
				'z-index': 99,
				'transition': '.5s'
			});
		})
		$('.close').on('click', function() {
			$('.share_popups').css({
				'opacity': 0,
				'z-index': -1,
				'transition': '.5s'
			});
		})
		$('#store').on('click', function() {
			alerts('商城功能未开放')
		})

		$('.store').on('click', function() {
			alerts('商城功能未开放')
		})
	});
	//请求banner图
	$.ajax({
		type: "get",
		url: site + '/user/banner',
		async: true,
		dataType: 'json',
		data: {
			bannerType: 1
		},
		success: function(data) {
			str(data);
		}
	});

	function str(data) {
		let uerbanne = data.data
		$.each(uerbanne, function(i, val) {
			$('.swiper-wrapper').append(' <div class="swiper-slide"><a href="' + val.url + '"><img src="' + val.bannerImage + '" alt=""/></a></div>')
		});
		var mySwiper = new Swiper('.banner', {
			loop: true,
			autoplay: 3000,
			autoplayDisableOnInteraction: false,
			pagination: '.swiper-pagination', // 如果需要分页器
			observer: true, //修改swiper自己或子元素时，自动初始化swiper
		});
	}
</script>
<script>
	var _hmt = _hmt || [];
	(function() {
		var hm = document.createElement("script");
		hm.src = "https://hm.baidu.com/hm.js?d69321757dcfbfbe09dbddd4dca87b28";
		var s = document.getElementsByTagName("script")[0];
		s.parentNode.insertBefore(hm, s);
	})();

	var nativeShare = new NativeShare()
	$.ajax({
		type: "get",
		url: site + "/login/queryShare",
		success: function(data) {
			var jsons = data.data
			var shareData = {
				title: jsons.title,
				desc: jsons.content,
				// 如果是微信该link的域名必须要在微信后台配置的安全域名之内的。
				link: jsons.url,
				icon: 'http://p3f4qdzqj.bkt.clouddn.com/1wzEJz8K8K8vLXEh3O3zuKmzm.jpg',
				// 不要过于依赖以下两个回调，很多浏览器是不支持的
				success: function() {
					alert('success')
				},
				fail: function() {
					alert('fail')
				}
			}
			nativeShare.setShareData(shareData)
		}
	});

	function call(command) {
		try {
			nativeShare.call(command)
		} catch(err) {
			// 如果不支持，你可以在这里做降级处理
			//          alerts("")
		}
	}

	function setTitle(title) {
		nativeShare.setShareData({
			title: title,
		})
	}
</script>